<?php
//个人信息
namespace Admin\Controller;
use Think\Controller;
use Mcit\Rbac;

class BaseController extends Controller {
    
    protected function _initialize(){
    	
        if( session('account')==null ){
			redirect(U('/Login/index'));
		}

        //安全检测
        //layout('layout');
        $whereMap['account'] = session("account");
        $userInfo = M('user')->where($whereMap)->find();
        if($userInfo['password'] == sha1("dz123456") ){
            $this->display("/Index/changePwd");
            exit;
        }

		header('Content-Type:text/html; charset=utf-8');
        if(!Rbac::checkAuth()){
        	$this->display("Public:auth");
        	exit;
        }
	}

    //空操作
    function   _empty(){

        header( " HTTP/1.0  404  Not Found" );

        layout(false);

        $this->display("Public:404");

        exit;
    }

}